<!DOCTYPE html>

<head>
    <script src="https://unpkg.com/vue@3"></script>
    <title>第一次作业</title>
</head>
    


<div id="app">
    
    <input v-model="message"/>
    <button @click="submit">提交</button>
    <li v-for="index in lists">
        {{index.message}}
    </li>
</div>

<script>
  const { createApp } = Vue

  createApp({
    data() {
      return {
        message: '',
        lists:[{ message: 'Foo' }, { message: 'Bar' }]
      }
    },
    methods:{
        submit(){
            console.log(this.lists)
            this.lists.push({"message": this.message});
            this.message=""
            
        }
    }

  }).mount('#app')
</script>